/*
 * Application.h
 *
 *  Created on: 2018年7月25日
 *      Author: terry
 */

#ifndef APPLICATION_H_
#define APPLICATION_H_

#include "PolisherOperator.h"
#include "SerialPort.h"

class Application
{
public:
	static Application& instance();

public:
	Application();
	virtual ~Application();

	int init();

	void quit();

	void setDisplayCallback(PoDisplayCallback cb, void* user);

	void display(int code, int value);

	void setupSerialPort(const char* port, int baudrate);

	void sendDataTo232(const char* data, int length);

protected:
	void teardownSerialPort();

	void demoRead();

protected:
	PoDisplayCallback	m_cb;
	void*	m_user;

	CSerialPort	m_serialPort;

};

#endif /* APPLICATION_H_ */
